package de.yvert.jingle.impl.writer;

import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import de.yvert.jingle.Image;
import de.yvert.jingle.ImageType;
import de.yvert.jingle.ImageWriter;
import de.yvert.jingle.hdr.HdrImage2D;
import de.yvert.jingle.impl.openexr.ExrWriter;

/**
 * @author Ulf Ochsenfahrt
 */
public class ImageWriter_exr implements ImageWriter
{

public ImageWriter_exr()
{/*OK*/}

public String getExtension()
{ return "exr"; }

public ImageType[] supportedTypes()
{ return new ImageType[] { ImageType.RGBA_2D_FLOAT }; }

public void write(Image in, OutputStream out) throws IOException
{
	HdrImage2D image = (HdrImage2D) in;
	ExrWriter writer = new ExrWriter(new BufferedOutputStream(out));
	writer.write(image);
}

}
